package org.example.maven.pojo;

import lombok.Data;
import org.example.maven.pojo.list.ListTableCollectionAddDetail;

import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
public class ProvenanceSource {
    private Integer id;
    private Integer collectionId;
    private ProvenanceSourceAcquisitionType acquisitionType=ProvenanceSourceAcquisitionType.其他;
    private LocalDate acquisitionDate;
    private String donorName;
    private String sourceDetail;
    private String certificateNo;
    public enum ProvenanceSourceAcquisitionType {
        捐赠("捐赠"),
        购买("购买"),
        考古发掘("考古发掘"),
        调拨("调拨"),
        其他("其他");
        private final String chineseName;

        ProvenanceSourceAcquisitionType(String chineseName) {
            this.chineseName = chineseName;
        }
        public String getChineseName() {
            return chineseName;
        }
        public static ProvenanceSourceAcquisitionType fromChineseName(String chineseName) {
            for (ProvenanceSourceAcquisitionType status : values()) {
                if (status.chineseName.equals(chineseName)) {
                    return status;
                }
            }
            throw new IllegalArgumentException("无效的保存状态eeee: " + chineseName);
        }
    }

}
